package com.university.mentalhealthplatform.studentV3.repository;


import com.university.mentalhealthplatform.appModels.Test;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.List;

public interface TestRepositoryV3 extends JpaRepository<Test, Integer> {

    @Query(value = "SELECT * FROM test ORDER BY RAND() LIMIT :count", nativeQuery = true)
    List<Test> findRandomTests(@Param("count") int count);
}

